package com.pro.addresslist.ui.view;

import java.util.Comparator;

import com.pro.addresslist.dal.model.ContactInfoBySqlite;
import com.pro.addresslist.dal.model.SortModel;

/**
 * 
 * @author xiaanming
 *
 */
public class PinyinComparator implements Comparator<ContactInfoBySqlite> {

	public int compare(ContactInfoBySqlite o1, ContactInfoBySqlite o2) {
		//这里主要是用来对ListView里面的数据根据ABCDEFG...来排序 
		if (o1.get_NAMEPY().equals("@")
				|| o2.get_NAMEPY().equals("#")) {
			return -1;
		} else if (o1.get_NAMEPY().equals("#")
				|| o2.get_NAMEPY().equals("@")) {
			return 1;
		} else {
			return o1.get_NAMEPY().compareTo(o2.get_NAMEPY());
		}
	}

}
